<?php
#teste
namespace Agp\CoreBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\Common\Collections\ArrayCollection;
use APY\DataGridBundle\Grid\Mapping as GRID;
use Agp\CoreBundle\Validator\Constraints as CoreAssert;

/**
 * Agp\CoreBundle\Entity\Agenda
 *
 * @ORM\Table(name="agenda")
 * @ORM\Entity(repositoryClass="Agp\CoreBundle\Repository\AgendaRepository")
 * 
 * @GRID\Source(columns="codAgenda, iccid, operadora, tipo, numero")
 * @CoreAssert\TerminalDisponivel
 */
class Agenda
{
    /**
     * @var integer $codAgenda
     *
     * @ORM\Column(name="cod_agenda", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     * 
     * @GRID\Column(title="Código", type="text", size="5", primary=true, visible=false)
     */
    protected $codAgenda;

    /**
     * @var string $descricao
     *
     * @ORM\Column(name="descricao", type="string", length=30)
     * @Assert\Length(
     *      max = "30"
     * )
     * 
     * @GRID\Column(title="Descrição", type="text")
     * 
     * @Assert\NotBlank()
     */
    protected $descricao;
    
    /**
     * @var string $cor
     *
     * @ORM\Column(name="cor", type="string", length=42)
     * 
     * @Assert\NotBlank()
     */
    protected $cor;
    
    /**
     * @var string $qtdeTerminal
     *
     * @ORM\Column(name="qtde_terminal", type="integer")
     * @Assert\NotBlank()
     *
     * @GRID\Column(title="Qtde de terminais", type="text")
     */
    protected $qtdeTerminal;
    
    /**
     *
     * @var datetime
     * 
     * @ORM\Column(name="dt_inicio", type="datetime", nullable=false)
     * @Assert\NotBlank()
     * 
     * @GRID\Column(title="Data de início", type="datetime", align="center")
     * 
     */
    protected $dtInicio;
    
    /**
     *
     * @var datetime
     * 
     * @ORM\Column(name="dt_termino", type="datetime", nullable=false)
     * @Assert\NotBlank()
     * 
     * @GRID\Column(title="Data de término", type="datetime", align="center")
     * 
     */
    protected $dtTermino;
    
    /**
     *
     * @var datetime
     * 
     * @ORM\Column(name="dt_envio", type="datetime", nullable=false)
     * @Assert\NotBlank()
     * 
     * @GRID\Column(title="Data de envio", type="datetime", align="center")
     * 
     */
    protected $dtEnvio;
    
    /**
     *
     * @var datetime
     * 
     * @ORM\Column(name="dt_recebimento", type="datetime", nullable=false)
     * @Assert\NotBlank()
     * 
     * @GRID\Column(title="Data de recebimento", type="datetime", align="center")
     * 
     */
    protected $dtRecebimento;
    
    /**
     * @var string $observacao
     *
     * @ORM\Column(name="observacao", type="text", nullable=true)
     */
    protected $observacao;
    
    /**
     * @var string $observacao
     *
     * @ORM\Column(name="offline", type="boolean", nullable=false)
     */
    protected $offline;
    
    /**
     * @var string $preparado
     *
     * @ORM\Column(name="preparado", type="boolean", nullable=false)
     */
    protected $preparado;
    
    /**
     * @var string $observacao
     *
     * @ORM\Column(name="enviado", type="boolean", nullable=false)
     */
    protected $enviado;
    
    public function __construct() {
        $this->terminais = new ArrayCollection();
        $this->cor = dechex(rand(256,16777215));
        $this->offline = false;
        $this->preparado = false;
        $this->enviado = false;
    }

    public function getCodAgenda() {
        return $this->codAgenda;
    }

    public function setCodAgenda($codAgenda) {
        $this->codAgenda = $codAgenda;
    }
    
    public function getDescricao() {
        return $this->descricao;
    }

    public function getDtInicio() {
        return $this->dtInicio;
    }

    public function getDtTermino() {
        return $this->dtTermino;
    }

    public function getDtEnvio() {
        return $this->dtEnvio;
    }

    public function getDtRecebimento() {
        return $this->dtRecebimento;
    }
    
    public function setDescricao($descricao) {
        $this->descricao = $descricao;
    }

    
    public function setDtInicio($dtInicio) {
        $this->dtInicio = $dtInicio;
    }

    public function setDtTermino($dtTermino) {
        $this->dtTermino = $dtTermino;
    }

    public function setDtEnvio($dtEnvio) {
        $this->dtEnvio = $dtEnvio;
    }

    public function setDtRecebimento($dtRecebimento) {
        $this->dtRecebimento = $dtRecebimento;
    }

    public function setTerminais(ArrayCollection $terminais) {
        $this->terminais = $terminais;
    }
    
    public function getQtdeTerminal() {
        return $this->qtdeTerminal;
    }

    public function setQtdeTerminal($qtdeTerminal) {
        $this->qtdeTerminal = $qtdeTerminal;
    }
    
    public function getCor() {
        return $this->cor;
    }

    public function setCor($cor) {
        $this->cor = $cor;
    }
    
    public function getObservacao() {
        return $this->observacao;
    }

    public function setObservacao($observacao) {
        $this->observacao = $observacao;
    }
    
    public function getOffline() {
        return $this->offline;
    }

    public function getPreparado() {
        return $this->preparado;
    }

    public function getEnviado() {
        return $this->enviado;
    }

    public function setOffline($offline) {
        $this->offline = $offline;
        return $this;
    }

    public function setPreparado($preparado) {
        $this->preparado = $preparado;
        return $this;
    }

    public function setEnviado($enviado) {
        $this->enviado = $enviado;
        return $this;
    }


}
